package com.zxkj.logistics.controller;

import com.zxkj.logistics.model.User;
import com.zxkj.logistics.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/add")
    @ResponseBody
    public int addUser(User user){
        return userService.addUser(user);
    }

    @RequestMapping("/all")
    @ResponseBody
    public Object findAllUser(int pageNum,int pageSize){
        return userService.findAllUser(pageNum,pageSize);
    }

}
